Skip to content

[not for land] hook up MX to CUDA 12.8 cuBLAS MX gemm #1625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Jan 27, 2025

Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Status:

performance

  • [done] torch._scaled_mm performance as expected: seeing about 2x speedup from bf16 to mxfp8, and 4x from bf16 to nvfp4
  • [not in this PR] fast scaling kernels

numerics - mxfp8

  • [done] hello world
  • [done] check numerics with A and B set to eye-one and scales set to all-ones
  • [done] numerics match fp32 baseline and mx emulation with a single tile (M == K == N == 128), with torch.randn inputs
  • [done] numerics match fp32 baseline for multiple tiles, of various shapes
  • [done] (not in this PR) train llama with real MX gemm and get decent numerics

numerics - nvfp4

  • [done] hello world
  • [not done] repeat all steps of mxfp8 numerics testing

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@vkuzo
Copy link
Contributor Author

vkuzo commented Jan 27, 2025

Copy link

pytorch-bot bot commented Jan 27, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1625

Note: Links to docs will display an error until the docs builds have been completed.

❌ 9 New Failures

As of commit c8d768e with merge base 47f96f1 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 27, 2025
vkuzo added a commit that referenced this pull request Jan 27, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: dcde36f
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
@vkuzo vkuzo added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label Jan 27, 2025
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 27, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 9d7e307
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 27, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 5442d55
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 27, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: cd9d044
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 27, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: bebf96f
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
vkuzo added a commit that referenced this pull request Jan 27, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: bebf96f
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 28, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: af1626e
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
# 11
# 11
#
# for each row in rows of A:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scale_A

# 11
#
# for each row in rows of A:
# for each ol in cols of A:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scale_A

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 28, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e7a7997
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 28, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 946b39a
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 28, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e8b0cfb
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 28, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 8a7803b
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 28, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 599acd3
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 28, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: d3762db
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jan 28, 2025
Summary:

Requires https://github.com/pytorch/pytorch/pull/145562/files

None of this is for land - just testing for now as we work on a long
term support plan.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: d24fb59
ghstack-comment-id: 2616580142
Pull Request resolved: #1625
@drisspg drisspg mentioned this pull request Jan 29, 2025
@vkuzo vkuzo closed this Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants